home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / dos_win / winsock / maillist / 94-03.Z / 94-03 / text0166.txt < prev    next >
Encoding:
Text File  |  1994-03-30  |  983 b   |  36 lines

  1.  
  2.  >> 
  3.  >> #define FD_CLR(fd, set) do { \
  4.  >>     u_int __i; \
  5.  >>     for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \
  6.  >>         if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \
  7.  >>             while (__i < ((fd_set FAR *)(set))->fd_count-1) { \
  8.  >>                 ((fd_set FAR *)(set))->fd_array[__i] = \
  9.  >>                     ((fd_set FAR *)(set))->fd_array[__i+1]; \
  10.  >>                 __i++; \
  11.  >>             } \
  12.  >>             ((fd_set FAR *)(set))->fd_count--; \
  13.  >>             break; \
  14.  >>         } \
  15.  >>     } \
  16.  >> } while(0)
  17.  >> 
  18.  >> #define FD_SET(fd, set) do { \
  19.  >>     if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \
  20.  >>         ((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=fd;\
  21.  >> } while(0)
  22.  >>
  23.  
  24. These macros are far to complex for the poor old compilers we MS-Windows
  25. types use.
  26.  
  27. I quiver at the thought of having to debug macro's like this in a segmented
  28. CPU environment.
  29.  
  30. KISS.
  31.  
  32.  
  33. Larry Backman
  34. FTP Software
  35.  
  36.